/*
 * Copyright (c) 2006-2024, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-11-24     RT-Thread    first version
 */

#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>

#include <stdint.h>

#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>


/* defined the LED0 pin: PA5 */
#define LED0_PIN               GET_PIN(C, 13)

int main(void)
{
#if 0
    uint16_t count=0;
#endif
    /* set LED0 pin mode to output */
    rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);

    while (1)
    {
#if 0
        count+=100;
        if(count>=1000)
            count = 0;

        rt_pin_write(LED0_PIN, PIN_HIGH);
        rt_thread_mdelay(count);
        rt_pin_write(LED0_PIN, PIN_LOW);
        rt_thread_mdelay(1000-count);
#endif
        rt_pin_write(LED0_PIN, PIN_HIGH);
        rt_thread_mdelay(500);
        rt_pin_write(LED0_PIN, PIN_LOW);
        rt_thread_mdelay(500);
    }

    return RT_EOK;
}
